package tk.pptiger.controller;

import java.io.*;
import javax.servlet.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;

// 这里为什么用 {} ?
@WebServlet(name="BaseServlet", urlPatterns={"/urlfun"}, loadOnStartup=1)
class UrlFunServlet extends HttpServlet {
	@Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
		throws ServletException, IOException {
		PrintWriter out = resp.getWriter();
        out.println("<html>");
        out.println("    <head>");
        out.println("        <title>Servlet ShowHeader</title>");
        out.println("    </head>");
        out.println("    <body>");
        out.println(        req.getRequestURI() + "<br>");
        out.println(        req.getContextPath() + "<br>");
        out.println(        req.getServletPath() + "<br>");
        out.println(        req.getPathInfo());
        out.println("    </body>");
        out.println("</html>");
        out.close();
	}
}
